<?php
/**
 * This file is part of webman.
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the MIT-LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @author    walkor<walkor@workerman.net>
 * @copyright walkor<walkor@workerman.net>
 * @link      http://www.workerman.net/
 * @license   http://www.opensource.org/licenses/mit-license.php MIT License
 */

use Webman\Route;

Route::options('[{path:.+}]', function (){
    return response('');
});
Route::group('/api', function (){
    Route::group('/weapp', function (){
        Route::group('/index',function(){
            Route::get('/test', [app\weapp\controller\IndexController::class, 'test']);  //隐私协议
            Route::post('/loginByCode', [app\weapp\controller\IndexController::class, 'loginByCode']);  //code登录
            Route::post('/login',  [app\weapp\controller\IndexController::class, 'login']);  //微信登录
            Route::post('/upload',  [app\weapp\controller\IndexController::class, 'upload']);  //upload
        });
        Route::group('/customer',function(){
            Route::post('/getListGroupLetter', [app\weapp\controller\CustomerController::class, 'getListGroupLetter']);  //顾客列表groupLetter
            Route::post('/setAvatar', [app\weapp\controller\CustomerController::class, 'setAvatar']);
        });
        Route::group('/employee',function(){
            Route::post('/info', [app\weapp\controller\EmployeeController::class, 'info']);  //店员信息
            Route::post('/setInfo', [app\weapp\controller\EmployeeController::class, 'setInfo']);  //店员信息
        });
        Route::group('/products',function(){
            Route::post('/listForCheckOut', [app\weapp\controller\ProductsController::class, 'listForCheckOut']); //收银页面商品列表 分类
            Route::post('/editInfo', [app\weapp\controller\ProductsController::class, 'editInfo']);
            Route::post('/update', [app\weapp\controller\ProductsController::class, 'update']);
            Route::post('/list', [app\weapp\controller\ProductsController::class, 'list']);
            Route::post('/getCates', [app\weapp\controller\ProductsController::class, 'getCates']);
            Route::post('/del', [app\weapp\controller\ProductsController::class, 'del']);
        });
    });
});
Route::fallback(function(){
    return view('index/view');
});

Route::disableDefaultRoute();

